package main

import (
	"bytes"
	"crypto/sha1"
	"encoding/base64"
)

func maskBytes(key [4]byte, pos int, b []byte) int {
	for i := range b {
		b[i] ^= key[pos&3]
		pos++
	}
	return pos & 3
}

var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")

func computeAcceptKey(challengeKey string) string {
	h := sha1.New()
	h.Write([]byte(challengeKey))
	h.Write(keyGUID)
	return base64.StdEncoding.EncodeToString(h.Sum(nil))
}


func main() {
	println("------------")
	buff6 := []byte("abc abc abc    abc")
	arr := bytes.Fields(buff6)
	for _, v := range arr {
		for _, t := range v {
			print(t)
			print(",")
		}
		println("|")
	}
	print maskBytes(keyGUID, 3, buff6)

}

